/*
 * Main.java
 *
 * Created on April 4, 2007, 5:28 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package localSite;

import localSite.vendingMachineDB.VendingMachineRecord;

/**
 *
 * @author David Roberts
 */
public class Main
{
    
    public static void main (String[] args)
    {
        //create a site
        LocalSite site1 = new LocalSite ();
        
        //create a vending machine
        int ID = 1000;
        String location = new String ("2000 Nasa Blvd, Melbourne, FL");
        String lessor = new String ("Northrop Grumman");
        VendingMachineRecord vend1 = new VendingMachineRecord (ID, location, lessor, null, null );
        
        //add Vend to site1
        site1.oMgr.addVendingMachine (vend1);
        
        //add a couple sales to the sales DB
        
//        SalesRecord sale1 = new SalesRecord ();
//        sale1.date = new Date ();
//        sale1.transactionID = 1;
//        sale1.transactionTotal = 10.98;
//        
//        site1.sMgr.recordSale (sale1);
//        
//        SalesRecord sale2 = new SalesRecord ();
//        sale2.date = new Date ();
//        sale2.transactionID  = 2;
//        sale2.transactionTotal = 6.34;
//        
//        site1.sMgr.recordSale (sale2);
//        
//        site1.sMgr.createReport (new Date());
        
        //wait for messages from vending machines
        while(true)
        {
            try
            {
                Thread.sleep (200);
            }
            catch (Exception e)
            {
                System.out.println (e.toString ());
            }
        }
        
    }
    
}
